package utilities.stemmer;

import java.util.LinkedList;
import java.util.List;

import utilities.FileInput;

public class StemmerTest {

	public static void main(String[] args) {
		Stemmer stem = new Stemmer();
		
		//stem.main();
		//TODO read a file
		//TODO pass a string/chars to Stemmer.stem
		//TODO get the result from Stemmer.stem
		
		FileInput txtFile = new FileInput("C:\\Users\\asl\\Desktop\\Roy\\workspace\\Comp433\\Comp433\\src\\files\\MyFile.txt");
		
		List<String[]> lineList = new LinkedList<String[]>();
		StopWordFinder stopWord = new StopWordFinder();
		int i = 1;
		while(txtFile.hasNextLine())
		{
			String text = txtFile.nextLine();
			String[] textParts = text.split(" ");
			lineList.add(textParts);
			
			for(String keyword : textParts)
			{
				if(!stopWord.isStopWord(keyword))
				{
					String word = stem.stem(keyword);
					if(!word.isEmpty())
						System.out.println(i++ + ": " + word);
				}
				
			}
			
		}
		
	}

}
